import Mock, {Random} from "mockjs";


const filterList = [
    {
        "value": 1,
        "key": 1,
        "label": "田园"
    },
    {
        "value": 2,
        "key": 2,
        "label": "狸花猫"
    },
    {
        "value": 3,
        "key": 3,
        "label": "英短"
    },
    {
        "value": 4,
        "key": 4,
        "label": "美短"
    },
    {
        "value": 5,
        "key": 5,
        "label": "蓝猫"
    },
    {
        "value": 6,
        "key": 6,
        "label": "虎斑"
    },
    {
        "value": 7,
        "key": 7,
        "label": "加菲"
    },
    {
        "value": 8,
        "key": 8,
        "label": "布偶"
    },
    {
        "value": 9,
        "key": 9,
        "label": "瞿罗"
    }
];

export default {
    "GET /api/cats/varietys": (req, res) => {
        res.send({
            "code": 0,
            "data": {
                list: filterList
            }
        });
    },
    "POST /api/cats": (req, res) => {
        const {pager} = req.body;
        res.send(Mock.mock({
            "code": 0,
            "data": {
                "list|100": [
                    {
                        "id|+1": 1,
                        "name": "@cname",
                        "age|+1": 1,
                        "color": "@color",
                        "variety|1": [1, 2, 3, 4, 5, 6, 7, 8, 9],
                        "birthday": "@datetime",
                        "createdAt": "@datetime",
                        "updatedAt": "@datetime",
                    }
                ],
            },
            "pager": pager || {
                "current": 1,
                "pageSize": 10,
                "total": 100
            }
        }));
    },
    "POST /api/crud/save": {"code": 0},
    "DELETE /api/crud/del": {"code": 0},
};
